#!/usr/bin/perl -w
sub total {
$num = 0;
foreach (@_) {
$num += $_;
 }
$num;
}

@fred = ( 1..1000 );
$fred_total = total(@fred);
print "The total of \@fred is $fred_total \n";

